#pragma once

#include "utils/object.h"

#include <rclcpp/rclcpp.hpp>

namespace fusion_perception {

class FusionPerception;
class RosAdapter {
public:
    RosAdapter(void) = default;
    void work(void);

private:
    void onObjectsFromMultiSensor(ObjectsSptr msgSptr);
    void onMultiFusedResult(const ObjectSptrVector& objectSptrVector);

private:
    std::shared_ptr<FusionPerception> fusionPerceptionSptr_ { nullptr };

    std::shared_ptr<rclcpp::Subscription<Objects>> radarObjectReceiverSptr_ { nullptr };
    std::shared_ptr<rclcpp::Subscription<Objects>> radarFusedObjectReceiverSptr_ { nullptr };
    std::shared_ptr<rclcpp::Subscription<Objects>> cameraFusedObjectReceiverSptr_ { nullptr };
    std::shared_ptr<rclcpp::Publisher<Objects>> multiFusedObjectPublisher_ { nullptr };

    std::shared_ptr<rclcpp::ParameterEventHandler> param_subscriber_;
    std::shared_ptr<rclcpp::ParameterCallbackHandle> cb_handle_;
};
}